package cn.com.surker.production.dao;

import cn.com.surker.production.entity.TranCar;
import cn.com.surker.production.entity.vo.PumpDeviceVo;
import cn.com.surker.production.entity.vo.TranCarVo;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 生产车辆表 Mapper 接口
 * </p>
 *
 * @author admin
 * @since 2024-09-04
 */
public interface TranCarDao extends BaseMapper<TranCar> {

	IPage<TranCarVo> selectFullPage(Page<TranCar> tPage, @Param(Constants.WRAPPER) QueryWrapper<TranCarVo> qw);

	/**
	 * @param orgId
	 * @param carStatusList
	 * @param sortBy
	 * @return
	 */
	List<TranCarVo> findOrgList(Long orgId, List<Integer> carStatusList, String sortBy);

	/**
	 * 查询车辆的自编号
	 *
	 * @param orgId    站点id
	 * @param carId    车辆id
	 * @param taskTime 生效时间
	 * @return
	 */
	String queryCarCode(Long orgId, Long carId, String taskTime);

	/**
	 * 根据自编号查询车辆
	 *
	 * @param orgId
	 * @param code
	 * @param taskTime
	 * @return
	 */
	Long queryCarId(Long orgId, String code, String taskTime);

	/**
	 * 根据车辆自编号，查询车辆状态
	 * @param dbCode
	 * @param orgId
	 * @param code 自编号
	 * @param carStatus CarWorkStatusEnum
	 * @return
	 */
	TranCar findCloudByCode(String dbCode, Long orgId, String code, Integer carStatus);

	/**
	 * 查询配额票数据
	 *
	 * @param orgId
	 * @return
	 */
	List<TranCarVo> findQuotaList(Long orgId);
}
